package com.zhoun.util;

import org.apache.shiro.crypto.hash.Md5Hash;

/**
 * Md5加密工具类
 */
public class Md5Util {
    public static final String SALT = "JAVAYZ";

    /**
     * Md5加密
     * @param str
     * @param salt
     * @return
     */
    public static String md5(String str,String salt){
        return new Md5Hash(str,salt).toString();
    }

    public static void main(String[] args) {
        String password = "admin";
        System.out.println("加密后的密码是："+Md5Util.md5(password,SALT));
    }
}
